package com.teamcenter.rac.massupdate.ui;

import com.teamcenter.rac.massupdate.model.ImpactedPart;
import com.teamcenter.rac.massupdate.model.MassUpdateWizardInput;
import com.teamcenter.rac.massupdate.model.UpdateJobModel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.databinding.observable.list.WritableList;
import org.eclipse.jface.wizard.Wizard;
@SuppressWarnings({"rawtypes","unchecked"})
public class MassUpdateWizard
  extends Wizard
{
  private List<ImpactedPart> m_impactedParts;
  private UpdateJobModel m_updateJobModel;
  
  public MassUpdateWizard(MassUpdateWizardInput paramMassUpdateWizardInput)
  {
    setWindowTitle(paramMassUpdateWizardInput.getWizardTitle());
    this.m_updateJobModel = paramMassUpdateWizardInput.getUpdateJobModel();
    AbstractBindingWizardPage[] arrayOfAbstractBindingWizardPage = paramMassUpdateWizardInput.getWizardPages();
    int i = arrayOfAbstractBindingWizardPage.length;
    for (int j = 0; j < i; j++) {
      addPage(arrayOfAbstractBindingWizardPage[j]);
    }
  }
  
  public List<ImpactedPart> getImpactedParts()
  {
    WritableList localWritableList = this.m_updateJobModel.getImpactedParts();
    if (localWritableList != null)
    {
      Iterator localIterator = localWritableList.iterator();
      while (localIterator.hasNext())
      {
        Object localObject = localIterator.next();
        addImpactedPart((ImpactedPart)localObject);
      }
    }
    return this.m_impactedParts;
  }
  
  public UpdateJobModel getUpdateJobModel()
  {
    return this.m_updateJobModel;
  }
  
  public boolean performFinish()
  {
    return true;
  }
  
  private void addImpactedPart(ImpactedPart paramImpactedPart)
  {
    if (paramImpactedPart == null) {
      return;
    }
    if (this.m_impactedParts == null) {
      this.m_impactedParts = new ArrayList();
    }
    this.m_impactedParts.add(paramImpactedPart);
  }
}
